<template>
    <ul class="footer">
        <li @click="toIndex">
            <i class="fa fa-home"></i>
            <p>首页</p>
        </li>
        <li @click="toBusinessLogin">
            <i class="fa fa-briefcase"></i>
            <p>商家</p>
        </li>
        <li @click="toOrderList">
            <i class="fa fa-file-text-o"></i>
            <p>订单</p>
        </li>
        <li @click="toMy">
            <i class="fa fa-user-o"></i>
            <p>我的</p>
        </li>
    </ul>
</template>
<script>
export default {
    name: 'Footer',
    methods: {
        toIndex() {
            this.$router.push({ path: '/index' });
        },
        toBusinessLogin() {
            this.$router.push({ path: '/business-login' });
        },
        toOrderList() {
            this.$router.push({ path: '/orderList' });
        },
        toMy() {
            this.$router.push({ path: '/my' });
        }
    }
}
</script>

<style>
.footer {
    width: 100%;
    height: 60px; /* 推荐用固定高度 */
    border-top: solid 1px #DDD;
    background-color: #fff;
    position: fixed;
    left: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
}

.footer li {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #999;
    user-select: none;
    cursor: pointer;
    width: 25%; /* 四个菜单均分 */
}

.footer li p {
    font-size: 14px;
    margin: 0;
}

.footer li i {
    font-size: 22px;
    margin-bottom: 4px;
}
</style>